<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title><h:form><h:outputText>Vorlesung #{lectureBean.lecture.info.name} belegen</h:outputText></h:form></title>
    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/templates/lecture.xhtml">
            <ui:define name="content">    
                <h:form>
                    <ice:dataTable value="#{assiginingBean.users}"
                                   var="u"
                                   sortColumn="name"
                                   sortAscending="true">
                        <ice:column>
                            <f:facet name="header">
                                    <ice:outputText value="Username" />
                            </f:facet>
                            <ice:outputText value="#{u.user.username}" />
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">                                                       
                                    <ice:outputText value="Übungsgruppe" />
                            </f:facet>
                                <ice:selectOneMenu value="#{u.eg}"
                                                   partialSubmit="true"
                                                   rendered="#{u.takePart}"
                                                   valueChangeListener="#{u.groupChanged}">
                                    <f:converter converterId="exerciseGroupConverter" />
                                    <f:selectItems value="#{assiginingBean.exerciseGroupsItems}"  />                                    
                                </ice:selectOneMenu>
                                <ice:outputText value="Nimmt nicht an Übungen teil"
                                                rendered="#{!u.takePart}" />
                                <ice:commandLink value="teilnehmen lassen"
                                                 rendered="#{!u.takePart}"
                                                 action="#{u.toggle()}" />
                                <ice:outputText value="#{u.eg}" />
                            
                        </ice:column>
                    </ice:dataTable>
                    </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
